<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<style>
	td{
	border:1px solid black
	}
</style>
<body style="text-align: center;">
<table style="margin:auto;border:1px solid black">
	<tr style="border:1px solid black">
		<td>商品id</td>
		<td>商品类型</td>
		<td colspan="3">商品详情</td>
	</tr>
	<c:forEach items="${types }" var="type">
		<tr>
			<td  rowspan="${type.products.size() }">${type.id }</td>
			<td  rowspan="${type.products.size() }">${type.name }</td>
			<td colspan="3" >
			<table style="width:100%;border:1px solid black">
			<tr >
				<td>商品名称</td>
				<td>商品价格</td>
				<td>商品数量</td>
			<tr>
			<c:forEach items="${type.products }" var="product">
			<tr >
				<td>${product.name }</td>
				<td>${product.price }</td>
				<td>${product.num }</td>
			<tr>
			</c:forEach>
			</table>
			</td>
			<c:if test="${type.products.size()>1 }">
			<c:forEach var="x" begin="0" end="${type.products.size()-2 }" >
				<tr></tr>
			</c:forEach>
			</c:if>
		</tr>
	</c:forEach>
</table>
</body>
</html>